package com.topscomm.mpm.xxlJob;

import com.topscomm.mpm.pojo.MpmProjectEntity;
import com.topscomm.mpm.service.IMpmProjectService;
import com.topscomm.pub.util.StringBufferProxy;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 项目异常状态检测
 */
@JobHandler(value = "projectExceptionCheck")
@Component
public class ProjectExceptionCheckJob extends IJobHandler {
    @Autowired
    private IMpmProjectService mpmProjectService;

    @Override
    public ReturnT<String> execute(String param) throws Exception {
        try {
            this.mpmProjectService.executeCheckJob();
            return ReturnT.SUCCESS;
        } catch (Exception ex) {
            return new ReturnT<>(ReturnT.FAIL_CODE, ex.getMessage());
        }
    }
}
